home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 426-450 / disk_446 / post / readme < prev    next >
Text File  |  1992-05-06  |  17KB  |  356 lines

  1. Postscript interpreter - README
  2. ===============================
  3.  
  4. Post V1.4 Copyright Adrian Aylward 1989, 1991
  5.  
  6. This distribution was released as the archive file "post13.lzh", ??-???-90
  7.  
  8. Files in this distribution:
  9.  
  10. README            This file
  11. Post.info         Icon file
  12. post              User interface
  13. post.doc          Documentation file
  14. postband          Band printing driver
  15. postband.doc      Documentation file
  16. postlj            LaserJet printing driver
  17. postlj.doc        Documentation file
  18. post.library      Shared library for Amiga 500/1000/2000
  19. post.library.2620 Shared library for Amiga 2500 etc. (68020/030, 68881/2)
  20. init.ps           Standard postscript startup file
  21. icon.ps           The postscript program that built the icon
  22.  
  23. Source files (user interface only), for programmers:
  24.  
  25. post.c            User interface, C main program
  26. postband.c        Band printing driver, C main program
  27. postlj.c          LaserJet printing driver, C main program
  28. postasm.a         User interface, assembler support
  29. postlib.h         Library interface header
  30. postlib.doc       Documentation file
  31. makefile          Make file
  32.  
  33. You will also need:
  34.  
  35. arp.library       Arp library, V39+
  36. conman            ConMan, V1.3+
  37.  
  38. You should find these on "All Good BBS's/disk libraries"
  39.  
  40. I have tested Post under WorkBench V1.3 only.  If you have 2.0 it should
  41. work, but you may need a more recent version of ConMan.  You may also need
  42. to use the CONDEV option to use ConMan instead of the standard console
  43. handler.
  44.  
  45. You will need at least a megabyte of memory.  Even with a megabyte you
  46. will have not be able to generate a full page in colour on the screen.
  47. For high density printer output (A4 at 300 dpi.) you will need 2 megabytes!  If memory is very tight, try running from the CLI, before workbench has
  48. been loaded.
  49.  
  50. Before using Post you will need to copy the library (post.library or
  51. post.library.2620) into your libs: directory.  If you have a 32 bit cpu
  52. (68020/030/040) and a floating point unit (68881/68882 or 68040) you can
  53. use the 2620 version of the library, which is compiled to use hardware
  54. floating point instructions and runs about twice as fast.  Otherwise you
  55. must use the standard library - if you try the 2620 version it will
  56. refuse to open.
  57.  
  58. Examples
  59. ========
  60.  
  61. The examples and demo programs are now being distributed separately.  Look
  62. out for the file "psdemos1.lzh".  (If you have the prerelease "post02.lzh"
  63. or one of the earlier releases there is no need to download them, as they
  64. have not changed significantly).
  65.  
  66. The PostScript Language
  67. =======================
  68.  
  69. If you don't know any PostScript I recomend obtaining a suitable tutorial
  70. book.  Try the "blue book" from Adobe:
  71.  
  72.     "PostScript Language Tutorial and Cookbook"
  73.     Adobe Systems Incorporated,
  74.     Addison-Wesley 1985, ISBN 0-201-10179-3
  75.  
  76. If you want to learn PostScript, Post is a valuable learning tool, as you
  77. run it interactively and view the output one the screen.  Without some basic
  78. knowledge you may find it difficult to understand what is happening if you
  79. have problems getting started.
  80.  
  81. The startup file
  82. ================
  83.  
  84. The standard startup file "init.ps" should be run before most programs.  You
  85. should read it and the comments within it, as you may wish to customise it.
  86. It defines useful operators to mimic a standard PostScript printer.  It also
  87. handles automatic font downloading (see below).
  88.  
  89. Getting started
  90. ===============
  91.  
  92. Make sure that you have ConMan (V1.3+) and the ARP library installed.
  93.  
  94. Copy the file post.library into your libs: directory.  If you have a
  95. 68020 or 68030 cpu and a 68881 or 6882 floating unit you can use the 2620
  96. version of the library instead - copy it to libs:post.library.
  97.  
  98. From the CLI you can just type "post init.ps screen", assuming that all the
  99. files are in the current directory.  You should see a new screen with a big
  100. requestor window appear.  Click on "OK" and wait while Post executes the
  101. startup file, then you are ready to go.
  102.  
  103. If it says that it can't get enough memory (if you have only 1 megabyte)
  104. try selecting "Black and White" on the requestor window, and selecting
  105. the "Close WBench" option.
  106.  
  107. For a quick check of the graphics, pick File/Interactive on the menu.  Then
  108. type into the narrow window at the top:
  109.  
  110.     200 200 150 0 360 arc stroke
  111.  
  112. The result should be a circle appearing in the lower window.  When you have
  113. finished playing, type "quit".  Then "Project/Quit" will return you to the
  114. CLI.
  115.  
  116. If you don't have any fonts yet all text output will just print as big dots.
  117. (Read the section below on fonts).  Make a "PSFonts:" directory and copy all
  118. your PostScript fonts into it.  (Don't confuse these with Amiga bitmapped
  119. fonts - these will NOT work, nor will .AFM font metric files)  Their names
  120. should be the same as their PostScript names - e.g. "PSFonts:Times-Roman",
  121. "PSFonts:Times-Bold".  The files can either be ASCII text or in IBM
  122. PostScript font format.  If you have copied them from an IBM disk you will
  123. have to change the names; since MSDOS can only handle 8 character names its
  124. stores Times-Roman as "TI______.PFB" and Times-Bold as "TIB_____.PFB".  Then
  125. Post will load the fonts automatically as they are needed.
  126.  
  127. To use the workbench startup click on the icon.  You will probably want to
  128. set up the tooltypes to execute the startup file "init.ps"; for now you can
  129. enter it in the requestor.
  130.  
  131. Fonts
  132. =====
  133.  
  134. As there are no fonts built in to the interpreter, all fonts must be loaded
  135. from the disk, as PostScript source.  The standard startup file redefines
  136. the findfont operator to automatically load fonts from the disk the first
  137. time they are referenced.  To use this, build a directory "PSFonts:" 
  138. containing your PostScript fonts.  The file names should be the same as the
  139. PostScript names, without the '/'.  You can add an extension if you wish,
  140. by editing the startup file.  You can also make it search more than one
  141. directory.
  142.  
  143. The startup file also defines a default font, which will be substituted if
  144. the font your program requests cannot be found.  The initial default font
  145. as set up by the standard startup file is a dummy font that prints big dots,
  146. but at least allows most text operations to proceed without producing errors.
  147. This means that if you don't have the font loading set up properly the only
  148. text output you will get is big dots.  So if that is what you see when you
  149. run Post it probably means that you don't have any fonts, rather than a
  150. problem with Post itself.
  151.  
  152. Since a font is loaded into the vm just like any other PostScript code, it
  153. will be discarded when the vm is restored.  This means that in a multiple
  154. page document the fonts will likely be reloaded on every page.  To save time,
  155. it is usually much better to preload the fonts you are going to need.  You
  156. can do this using the "load font" menu command, or you can write yourself
  157. a little PostScript program to load your favourite fonts.  (Exercise for
  158. the user: write a driver to extract the font names from a conforming
  159. PostScript program and preload them.)  If you are using a large number of
  160. different fonts at once you may need to increase the default vm size to
  161. contain them.
  162.  
  163. There are a number of commercial sources for fonts.  Both the Adobe type 1
  164. (encrypted) fonts and type 3 (standard downloadable) fonts are supported.
  165. Since type 1 fonts can contain special "hints" to improve the quality at
  166. small point sizes on low or medium resolution devices they usually give
  167. much higher quality results.  You can get type 1 fonts from Adobe, or a
  168. number of other vendors.
  169.  
  170. A good source of the standard set of 35 fonts as come on most PostScript
  171. printers is the Adobe Type Manager (13 fonts) and its associated Plus Pack
  172. (22 fonts).  The IBM version contains the fonts in a format which can be read
  173. by Post.  Various utility programs (e.g. CROSSDOS) are available to copy file
  174. from IBM 3.5 inch disks onto Amiga files.  Just copy the .PFB files into your
  175. PSFonts: directory, changing the names to their PostScript names. The Mac
  176. version contains the fonts too, but you need a utility program to change the
  177. file format.  The quality of the Adobe fonts is excellent; the printed
  178. output from Post on my LJIIP rivals that of a LaserWriter.
  179.  
  180. If you have any of the additional CompuGraphic outline fonts supplied by
  181. Gold Disk for use with their DTP programs you can generate type 3 fonts
  182. from them using their conversion program.  The quality is not as good as
  183. the original Compugraphic fonts but is acceptable for proofing purposes.
  184.  
  185. There are some freely copyable fonts tht were originally distributed with
  186. the GhostScript project (another freeware PostScript interpreter available
  187. on Unix).  The quality of these is not high, as they appear to have been
  188. generated by tracing bitmap outlines, but they will serve to get you
  189. started, and they are free.
  190.  
  191. There are also various shareware and PD fonts available.  Many of these were
  192. derived from the Mac or IBM.  They may still be in a foreign file format.
  193. The file should be converted to readable ASCII, with no strange control
  194. characters. Some of the fonts have Mac encoding vectors.  You won't notice
  195. the difference for the standard ASCII characters, as they are the
  196. same, but you may have to convert to the standard encoding to get
  197. more unusual characters like the trademark sign to work.  (Programs
  198. like Adobe illustrator do their own font encoding anyway.)  You
  199. will need to know some PostScript to make this change.  If you
  200. see the sequence "/Helvetica findfont /Encoding get" or
  201. "<dictionary> /MacVec get" try replacing it with "StandardEncoding".
  202.  
  203. You are recommended to ensure all your fonts have UniqueID's.  This makes
  204. the font caching code more efficient.  Often all you have to do is uncomment
  205. them in the source.  Any number will do for the ID (up to 2**24 - 1), as long
  206. as it is different for each of your fonts.  Make it a multiple of 4, as Adobe
  207. recommend adding 1 or 2 to the ID when modifying the font.
  208.  
  209. Each font should have a FontName entry.  This isn't actually required by
  210. Adobe, but certain programs such as Adobe Illustrator copy the font directory
  211. when recoding the font.  If the name is missing, you get a dictionary full
  212. error after the name has been added.
  213.  
  214. WorkBench 2.0
  215. =============
  216.  
  217. I don't have 2.0 myself, so I am not able to test Post under it.  But I
  218. understand that it works OK.  You need to set up ConMan it you want to
  219. run interactively.  It you mount it as "CNC:" the you can use the CONDEV
  220. option to access it.  Otherwise you will find the console output is going
  221. to the WorkBench screen.
  222.  
  223. Common problems
  224. ===============
  225.  
  226. Printers
  227. --------
  228.  
  229. Some people have difficulty in getting Post to work correctly with printer
  230. output.  The first thing to check is that you have your printer preferences
  231. set up properly.  Post uses the printer values to set the size and density
  232. of its page buffer, so if you have silly values set it may pick a silly
  233. value for its buffer size and fail due to running out of memory.  So Run
  234. Preferences, go to the graphic 2 screen, and check the page limits.  If you
  235. set the limits to "Absolute" then width and height should be in inches; if
  236. you choose "Pixels" then the dimensions are in dots.  Turn smoothing and
  237. centering off.  On the graphic 1 screen, set the Aspect to horizontal, the
  238. image to positive, and the shade to black and white or colour according to
  239. your printer.  If the output comes out distorted, to a silly scale, or with
  240. circles turned into ellipses, and takes forether to print, it is probably
  241. because the page size is wrong and the printer device is laboriously scaling
  242. it to fit.
  243.  
  244. If you are having problems with the printer setup, it is better to run Post
  245. interactively.  Then you can look at the values in the page size gadgets
  246. in the requestor window to check they are all sensible.
  247.  
  248. Most page printers (lasers, DeskJet) will give the best quality with density
  249. set to the highest value.  For matrix printers try both the highest and the
  250. next highest - as the pins usually overlap at high densities the quality may
  251. not be any better.  If you are very tight on memory then a lower density
  252. will reduce the amount needed for the page buffer.
  253.  
  254. The Workbench printer drivers print bitmapped graphics dumps within the
  255. text margins, whereas PostScript expects it bitmaps to begin right at the
  256. edges of the paper.  You can line things up properly by setting the page
  257. offset gadgets in the requestor window.  Once you have experimented to
  258. determine the proper values to can put them in a shell script, or set them
  259. in the WorkBench icon, so you don't have to type them every time.
  260.  
  261. If you have a LaserJet printer or one that emulates it, you should use the
  262. special driver "postlj".  It is faster, supports all the paper sizes in
  263. both posrtrait and landscape orientation, and avoids all the problems with
  264. the standard Workbench drivers interface.  I have tested it on my HP LJIIP,
  265. but it should work on other LaserJet compatibles.
  266.  
  267. Fonts
  268. -----
  269.  
  270. Most of the remaining troubles relate to fonts.  I personally recommend
  271. the Adobe fonts: the quality is excellent and you are assured of maximum
  272. compatability.  There are many other sources for fonts.  Even the shareware
  273. fonts normally work.  However being constructed slightly differently from the
  274. Adobe ones, they sometimes fail when programs attempt to modify them to
  275. change the character set encoding or character widths or obtain special
  276. effects.
  277.  
  278. Other troubles with fonts usually relate to not not being able to find the
  279. font file on the disk.  Read the comments in the init.ps file to see
  280. what directories in you filing system it is searching, also check whether
  281. you font files have extensions.  I prefer to keep my fonts without
  282. extensions, so for example on my machine "Times-Roman" is in the file
  283. "PSFonts:Times-Roman".  But you may want to keep the ".PFB" extension on
  284. your font filesif they are in IBM format - if you have other packages that
  285. like them that way.  You can easily change this by editing init.ps.
  286.  
  287. N.B. if you have some files with ".AFM" extensions they are NOT PostScript
  288. fonts.  The are font metric files that define the character widths and other
  289. data for use by application programs; they do not define the characters
  290. outlines themselves.  Ther are of no use to Post.
  291.  
  292. Use with other packages
  293. -----------------------
  294.  
  295. I have used Post extensively with PPage (V1.3).  Early versions of PPage
  296. had a bug in the PostScript prologue that caused a limitcheck error when
  297. doping patterened fills, but this has been fixed for a while now.  I find
  298. that printing using postlj is about five times faster than printing direct
  299. from PPage.  It solves the page offset problem.  Also, it gives access to
  300. the Adobe type 1 font range, which is considerably more extensive than the
  301. hinted versions of the Compugraphic fonts that are presently available.
  302.  
  303. I have tested a PageStream file.  There was a problem with the prologue
  304. not being compatable with downloaded Adobe fonts.  If you load all your
  305. fonts beforehand, using the "Load font" menu selection, it should work OK.
  306. Hopefully this will eb fixed soon.
  307.  
  308. I have printed Excellence! files successfully.
  309.  
  310. AmigaTeX with the PostScript driver should work OK.  I have seen a TeX
  311. example (from another system) that failed - it was trying to define a font
  312. with an encoding vector only 128 entries long.  If you meet this problem
  313. you can fix it if you are prepared to edit the PostScript file.
  314. vector only 128 entries long.
  315.  
  316. Debugging
  317. ---------
  318.  
  319. If your PostScript program is failing, if you know a little PostScript
  320. is usually quit easy to find out what is going wrong.  In fact if you are
  321. developing PostScript code Post is a much better debugging tool than your
  322. average PostScript printer.
  323.  
  324. It is normally best to use interactive mode for debugging.  Start up Post
  325. on the screen and pick the "interactive" option.  Then run you program
  326. from the interactive window.
  327.  
  328. To run your program, type:
  329.  
  330.     > (filename.ps) run
  331.  
  332. If it fails with an error message, you can then type interactive commands
  333. to see what happened.
  334.  
  335. To display the contents of the operand stack, type:
  336.  
  337.     > pstack
  338.  
  339. To display the contents of the execution stack at the point of the last
  340. error, type:
  341.  
  342.     > $error /estack get ==
  343.  
  344. To display the contents of any named variable, type:
  345.  
  346.     > varname ==
  347.  
  348. To see what is in the current dictionary, type:
  349.  
  350.     > currentdict {== ==} forall
  351.  
  352. If you have no idea how far your program got before it failed, try adding a
  353. few lines "1001 ==" "1002 ==" "1003 ==" to trace how far it got.  As
  354. PostScript files are pure ASCII text they are easy to inspect any modify
  355. with any editor.
  356.